﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Common;
using Persistence;
using Domain;
using Persistence.Dao;
namespace web.manage
{
    public partial class adminlogin : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            Administrators admin = Singleton<AdministratorsDao>.Instance.GetModel(username.Value.Trim(), password.Value.Trim());
            if (admin == null)
            {
                Message.alert("用户名或密码错误");
            }
            else
            {
                Session["admin"] = admin;
                Response.Redirect("index.aspx");
            }
        }
    }
}
